package com.testbank.practise.sqltables;

import android.content.ContentValues;

public class TestAttemptsTable {

	public static final String TABLE_NAME = "TestAttempts";
	
	public static final String KEY_ID = "localId";
	public static final String KEY_ATTEMPT_NUM = TestScoresTable.KEY_ATTEMPT_NUM;
	public static final String KEY_Q_ID = QuestionSetsTable.KEY_QID;
	public static final String KEY_OP_ARR = "optionArr";
	public static final String KEY_CHOICE = "choice";
	
	public static final String CREATE = "CREATE TABLE " + TABLE_NAME + " ("
									+ KEY_ID + " integer primary key, "
									+ KEY_ATTEMPT_NUM + " integer, "
									+ KEY_Q_ID + " integer, "
									+ KEY_OP_ARR + " text, "
									+ KEY_CHOICE + " integer);";

	public static final int KEY_ID_INDEX = 0;
	public static final int KEY_ATTEMPT_NUM_INDEX = 1;
	public static final int KEY_Q_ID_INDEX = 2;
	public static final int KEY_OP_ARR_INDEX = 3;
	public static final int KEY_CHOICE_INDEX = 4;
	
	public static ContentValues GetCVRow (long attemptNum, long qID, String opArr, int choice) {
		ContentValues newTestAttemptRow = new ContentValues();
		newTestAttemptRow.put(KEY_ATTEMPT_NUM, attemptNum);
		newTestAttemptRow.put(KEY_Q_ID, qID);
		newTestAttemptRow.put(KEY_OP_ARR, opArr);
		newTestAttemptRow.put(KEY_CHOICE, choice);
		
		return newTestAttemptRow;
	}
}
